package com.example.p2pmessages;

import java.util.ArrayList;
import java.util.List;

public class MessageStore implements OnMessage{
	private static List<Message> messageList;
	private static MessageStore instance = null;
	
	public MessageStore() {
		this.messageList = new ArrayList<Message>();
	}
	
	public static MessageStore getInstance() {
	      if(instance == null) {
	         instance = new MessageStore();
	      }
	      return instance;
	   }
	
	public void add(Message m) {
		this.messageList.add(m);
	}
	
	public List<Message> getMessageStore() {
		return this.messageList;
	}
}
